from fastapi.responses import JSONResponse

from common.base.base_routers import get_custom_router
from services.telemetry.api import TelemetryApi

tm_api = TelemetryApi()
telemetry_router = get_custom_router(tm_api, prefix='/telemetry', tags=['telemetry'])


@telemetry_router.get('/get-gps-telemetry/', response_class=JSONResponse)
async def get_gps_telemetry():
    return await tm_api.get_gps_telemetry()


@telemetry_router.get('/get-dsp-telemetry/', response_class=JSONResponse)
async def get_dsp_telemetry():
    return await tm_api.get_dsp_telemetry()


@telemetry_router.get('/get-pwr-telemetry/', response_class=JSONResponse)
async def get_pwr_telemetry():
    return await tm_api.get_pwr_telemetry()


@telemetry_router.get('/get-sfp-telemetry/', response_class=JSONResponse)
async def get_sfp_telemetry():
    return await tm_api.get_sfp_telemetry()


@telemetry_router.get('/get-numsv-telemetry/', response_class=JSONResponse)
async def get_numSV_telemetry():
    return await tm_api.get_numSV_telemetry()
